<?php
// +----------------------------------------------------------------------
// | quanli team
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2020 http://www.fistforward.com/ All rights reserved.
// +----------------------------------------------------------------------
// | Author: create by allen.qiang
// +----------------------------------------------------------------------

 
/**
 * 区域管理功能
 * @package  htdocs
 * @subpackage  quanliadmin
 * @author   create by allen.qiang
 */
quanli_require('module/base/system/sysRegion.class.php');
class pa_areaManage {

    public function execute() {

        if (isset($_REQUEST['operFlg']) && is_numeric($_REQUEST['operFlg']) && $_REQUEST['operFlg'] > 0) {

            switch ($_REQUEST['operFlg']){
                case 1: //区域管理列表
                    $this->areaManageList();
                    break;
                default:
                    $this->toError('参数错误');
                    break;
            }

        } else {

            $this->toError('参数错误');

        }

    }

    /**
     * 转跳到错误页面
     * @param string $msg 错误信息
     */
    private function toError( $msg = '' ) {

        global $G_PGLOB;

        $G_PGLOB->display_error_page( $msg );

    }

    //区域管理列表
    private function areaManageList(){

        global $G_PGLOB;

        $sysRegion = new sysRegion($G_PGLOB->DBCA);

        $arg_array = array(
            'parentID' => 0,
            'sortname' => 'sortOrder',
            'sortorder' => 'ASC'
        );

        $edit_permission = $G_PGLOB->has_permission(12);

        $areaList = $sysRegion->getAreaManageList($arg_array);

        $G_PGLOB->smarty->assign('edit_permission',$edit_permission);

        $G_PGLOB->smarty->assign_by_ref('areaList',$areaList);

        $G_PGLOB->smarty->display('system/areaManageList.tpl');

    }

}